package com.codingman.springbootdemo6;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class Demo4 {
	@Pointcut("execution(* Foo.msg(..))")
	public void d() {
	}

	@Around("d()")
	public Object myadvice(ProceedingJoinPoint pjp) throws Throwable {
		System.out.println("Before Around");
		Object obj = pjp.proceed();
		System.out.println("After Around");
		return obj;
	}
}
